/**
 * 
 */
package com.yjd.comm.pay.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author renbangjie
 *
 */
public enum RechChannel {

	PC(100001, "pc"),
	ANDROID(100008, "android"),
	IOS(100009, "ios");
	
	private int code;
	private String lable;
	
	private RechChannel(int code, String lable) {
		this.code = code;
		this.lable = lable;
	}

	public static RechChannel getChannel(String lable){
		RechChannel[] channels = RechChannel.values();
		for(RechChannel c : channels){
			if(StringUtils.isNotBlank(lable)&&lable.equalsIgnoreCase(c.getLable())){
				return c;
			}
		}
		return RechChannel.PC;
	}
	

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getLable() {
		return lable;
	}

	public void setLable(String lable) {
		this.lable = lable;
	}
	
}
